﻿<template>
    <div>
        <div class="big_box">
            <el-breadcrumb separator="/">
                <el-breadcrumb-item>人员管理</el-breadcrumb-item>
                <el-breadcrumb-item>部门列表</el-breadcrumb-item>
            </el-breadcrumb>
            <el-divider></el-divider>

            <el-form class="demo-form-inline" label-width="140px">
                <el-row>
                    <el-col :span="4">
                        <el-input v-model="like" placeholder="请输入部门编号或者部门名称"></el-input>
                    </el-col>
                    <el-col :span="2" style="padding-left:10px">
                        <el-button icon="el-icon-search" @click="GettableDB()"></el-button>
                    </el-col>
                </el-row>
                <el-row style="padding:10px">
                    <el-col :span="12">
                        <el-button-group>
                            <el-button class="buttongroup" type="danger" icon="el-icon-delete" @click="DelArray">批量删除
                            </el-button>
                            <el-button class="buttongroup" type="success" icon="el-icon-circle-plus-outline"
                                       @click="ShowAddDeparment">添加
                            </el-button>
                            <el-button class="buttongroup" type="success" @click="doFlowChart">组织架构</el-button>
                        </el-button-group>
                    </el-col>
                </el-row>
            </el-form>
            <el-row style="padding-top: 10px">
                <el-col>
                    <el-table :data="tableData"
                              :row-key="doRowKey"
                              :expand-row-keys="DepartmentIds"
                              @expand-change="onExpandChange"
                              border>
                        <el-table-column type="expand" fixed>
                            <template slot-scope="props">
                                <el-button type="success" class="BtnSize" size="mini" plain
                                           @click="onOperUser('add',{})">添加
                                </el-button>
                                <el-button type="primary" class="BtnSize" size="mini" plain
                                           @click="onOperUser('sets',{})">更改部门
                                </el-button>
                                <el-button class="BtnSize" size="mini" type="danger" icon="el-icon-delete" plain
                                           @click="onOperUser('dels',{})">批量删除
                                </el-button>
                                <el-table :data="userList[props.row.Id]"
                                          style="width: 100%;margin-top: 10px"
                                          ref="multipleTable"
                                          @selection-change="selectionLineChangeHandle"
                                          border
                                          :row-style="{height:'20px'}"
                                          :cell-style="{padding:'5px 0 '}">
                                    <el-table-column header-align="center" type="selection" width="50"
                                                     align="center"></el-table-column>
                                    <el-table-column header-align="center" fixed prop="UserName" label="姓名"
                                                     align="center" width="180px">
                                        <template slot-scope="scope">
                                            <el-row>
                                                <el-col :span="12">
                                                    {{scope.row.UserName}}
                                                </el-col>
                                                <el-col :span="11">
                                                    <el-button type="danger" class="BtnSize" size="mini" plain
                                                               v-if="props.row.LeaderShip === scope.row.Id">
                                                        分管领导
                                                    </el-button>
                                                    <el-button type="primary" class="BtnSize" size="mini" plain
                                                               v-else-if="props.row.PartOwner === scope.row.Id">
                                                        部长
                                                    </el-button>
                                                    <el-button type="warning" class="BtnSize" size="mini" plain
                                                               v-else-if="props.row.PartOwnerTwo === scope.row.Id">
                                                        副部长
                                                    </el-button>
                                                    <el-button type="info" class="BtnSize" size="mini" plain v-else>员工
                                                    </el-button>
                                                </el-col>
                                            </el-row>
                                        </template>
                                    </el-table-column>
                                    <el-table-column header-align="center" prop="Code" label="性别" align="center">
                                        <template slot-scope="scope">
                                            <label v-if="scope.row.Sex==0">男</label>
                                            <label v-else>女</label>
                                        </template>
                                    </el-table-column>
                                    <el-table-column header-align="center" prop="RoleId" label="岗位" align="center"
                                                     :show-overflow-tooltip="true">
                                        <template slot-scope="scope">
                                            {{RoleNamesByids(scope.row.RoleId)}}
                                        </template>
                                    </el-table-column>
                                    <el-table-column header-align="center" prop="RoleDuty" label="岗位职责" align="center"
                                                     :show-overflow-tooltip="true"></el-table-column>
                                    <el-table-column header-align="center" prop="Phone" label="联系电话" align="center"
                                                     width="150"></el-table-column>
                                    <el-table-column header-align="center" prop="UserPosition" label="员工职务"
                                                     align="center"
                                                     width="110">
                                        <template slot-scope="scope">
                                            {{UserPositionByid(scope.row.UserPosition)}}
                                        </template>
                                    </el-table-column>
                                    <el-table-column header-align="center" prop="JobNumber" label="工号" align="center"
                                                     width="110"></el-table-column>
                                    <el-table-column header-align="center" prop="Email" label="邮箱" align="center"
                                                     minWidth='220'
                                                     :show-overflow-tooltip="true"></el-table-column>
                                    <el-table-column header-align="center" prop="UserPosition" label="编辑" align="center"
                                                     width='250px'>
                                        <template slot-scope="scope">
                                            <el-button type="primary" class="BtnSize" size="mini" plain
                                                       @click="onOperUser('set',scope.row)">
                                                更改部门
                                            </el-button>
                                            <el-button type="danger" class="BtnSize" size="mini" plain
                                                       @click="onOperUser('del',scope.row)">
                                                删除
                                            </el-button>
                                        </template>
                                    </el-table-column>
                                </el-table>
                            </template>
                        </el-table-column>
                        <el-table-column header-align="center" fixed type="index" label="序号" width="50" align="center"
                                         :index="_indexMethod"></el-table-column>
                        <el-table-column header-align="center" fixed prop="DepartmentNumber" label="部门编号" align="center"
                                         :show-overflow-tooltip="true">
                        </el-table-column>
                        <el-table-column header-align="center" fixed prop="DepartmentName" label="部门名称" align="center">
                        </el-table-column>
                        <el-table-column header-align="center" prop="LeaderShip" label="分管领导" align="center">
                            <template slot-scope="scope">
                                {{GetUserNameById(scope.row.LeaderShip)}}
                            </template>
                        </el-table-column>
                        <el-table-column header-align="center" prop="PartOwner" label="部长" align="center">
                            <template slot-scope="scope">
                                {{GetUserNameById(scope.row.PartOwner)}}
                            </template>
                        </el-table-column>
                        <el-table-column header-align="center" prop="PartOwnerTwo" label="副部长" align="center">
                            <template slot-scope="scope">
                                {{GetUserNameById(scope.row.PartOwnerTwo)}}
                            </template>
                        </el-table-column>
                        <el-table-column header-align="center" prop="SectoralFunctions" label="部门职能" align="center"
                                         :show-overflow-tooltip="true"></el-table-column>
                        <el-table-column header-align="center" prop="PeopleCount" label="部门人数" align="center">
                        </el-table-column>
                        <el-table-column header-align="center" prop="AllWages" label="工资总额" align="center">
                        </el-table-column>
                        <el-table-column header-align="center" prop="Card" label="部门类型" align="center">
                            <template slot-scope="scope">
                                <label v-if="scope.row.DepartType==1">服务部门</label>
                                <label v-if="scope.row.DepartType==2">产值部门</label>
                                <label v-else></label>
                            </template>
                        </el-table-column>
                        <el-table-column header-align="center" prop="YearOutputValue" label="年度产值"
                                         align="center"></el-table-column>
                        <el-table-column header-align="center" prop="Code" label="编码" align="center"
                                         :show-overflow-tooltip="true"></el-table-column>
                        <el-table-column header-align="center" prop="Remarks" label="备注" align="center"
                                         :show-overflow-tooltip="true"></el-table-column>
                        <el-table-column header-align="center" prop="UserPosition" label="编辑" align="center"
                                         width='350px'>
                            <template slot-scope="scope">
                                <div v-if="scope.$index !== tableData.length - 1">
                                    <el-button type="primary" class="BtnSize" size="mini" plain
                                               @click="edit(scope.row)">
                                        编辑
                                    </el-button>
                                    <el-button type="warning" class="BtnSize" size="mini" plain
                                               @click="formal(scope.row)">
                                        撤销
                                    </el-button>
                                    <el-button type="danger" class="BtnSize" size="mini" plain
                                               @click="leave(scope.row)">
                                        删除
                                    </el-button>
                                    <el-button v-if="scope.$index !== 0" type="primary" class="BtnSize" size="mini"
                                               plain icon="el-icon-top" @click="onOperUser('top',scope.row)"/>
                                    <el-button v-if="scope.$index !== tableData.length - 2" type="primary"
                                               class="BtnSize" size="mini" plain icon="el-icon-bottom"
                                               @click="onOperUser('bottom',scope.row)"/>
                                </div>
                            </template>
                        </el-table-column>
                    </el-table>
                </el-col>
                <el-col :span="24">
                    <div class="block" style="float: right">
                        <el-pagination @size-change="GettableDB"
                                       @current-change="GettableDB"
                                       :current-page.sync="pagination.currentPage"
                                       :page-sizes="pagination.pagesizes"
                                       :page-size.sync="pagination.pagesize"
                                       layout="total, sizes, prev, pager, next, jumper"
                                       :total.sync="pagination.total">
                        </el-pagination>
                    </div>
                </el-col>
            </el-row>

        </div>

        <el-dialog :visible.sync="AddDepartmentShow" title="添加组织架构信息" width="70%">
            <AddDepartment
                    :AllUsers="AllUsers"
                    :AllDepartment="AllDepartment"
            ></AddDepartment>
        </el-dialog>
        <el-dialog :visible.sync="UpDepartmentShow" title="修改组织架构信息" width="70%">
            <UpDepartment
                    :UpDepartment="obj"
                    :AllUsers="AllUsers"
                    :AllDepartment="AllDepartment"
            ></UpDepartment>
        </el-dialog>
        <el-dialog :visible.sync="flowChartData.show" v-if="flowChartData.show" title="组织架构图" width="100%" top="0">
            <flowChart
                    :AllData="flowChartData.data"
            ></flowChart>
        </el-dialog>
        <el-dialog :visible.sync="operUserData.show" v-if="operUserData.show" :title="operUserData.title" width="50%">
            <el-form class="demo-form-inline">
                <el-row>
                    <el-col :span="12" v-if="operUserData.key === 'add'">
                        <el-form-item label="人员" prop="userId">
                            <el-select
                                    :filterable="true" v-model="operUserData.data.userId" multiple placeholder="请选择"
                                    style="width: 80%">
                                <el-option v-for="v in userList.all"
                                           :label="v.UserName" :value="v.Id + ''"/>
                            </el-select>
                        </el-form-item>
                    </el-col>
                    <el-col :span="12">
                        <el-form-item label="部门" prop="DepartmentId" v-if="operUserData.key !== 'add'">
                            <el-select v-model="operUserData.data.DepartmentId" class="wmax" required filterable
                                       style="width: 80%"
                                       placeholder="请选择部门">
                                <el-option v-for="(item,index) in tableData" :label="item.DepartmentName"
                                           :value="item.Id" :key="index"></el-option>
                            </el-select>
                        </el-form-item>
                    </el-col>
                    <el-col :span="24" style="text-align: center">
                        <el-button type="success" class="BtnSize"
                                   @click="onOperUser('post',{})">提交
                        </el-button>
                    </el-col>
                </el-row>
            </el-form>
        </el-dialog>
    </div>
</template>

<script>
    import AddDepartment from "./AddDepartment";
    import UpDepartment from "./UpDepartment";
    import FlowChart from "../../FlowChart"
    import * as publicjs from "/public/Scriput/Public"

    export default {
        components: {
            AddDepartment,
            UpDepartment,
            FlowChart
        },
        name: "UserInfo",
        data() {
            return {

                AddDepartmentShow: false,
                UpDepartmentShow: false,

                like: "",
                //表格数据信息
                tableData: [],
                flowChartData: {
                    show: false,
                    data: {},
                },
                //修改组织信息
                obj: {},
                //分页数据绑定
                pagination: {
                    currentPage: 1,
                    pagesizes: [15, 50, 100,],
                    pagesize: 15,
                    total: 0
                },
                AllRoleDB: [],
                AllDutyMains: [],
                userList: {},
                DepartmentIds: [],
                delidarray: {},
                operUserData: {
                    show: false,
                    title: "",
                    key: "",
                    data: {},
                },
            };
        },
        created() {
            this.AllUsers = publicjs.GetCompanyAllUsers(this.$http);
            this.AllDepartment = publicjs.GetAllDepartment(this.$http);
            this.AllRoleDB = publicjs.GetAllRole(this.$http);
            this.AllDutyMains = publicjs.GetAllDutyMains(this.$http);
            this.GettableDB();
        },
        methods: {
            _indexMethod(index) {
                return ((this.pagination.currentPage - 1) * this.pagination.pagesize) + index + 1
            },
            GettableDB() {
                const Loading = this.openLoading();
                this.$http.post("/Department/GetDepartment", {
                    like: this.like,
                    offset: this.pagination.currentPage,
                    limit: this.pagination.pagesize
                }).then(res => {
                    res.data.data.push({
                        DepartmentName: "未分配部门人员",
                        Id: 0,
                    })
                    this.tableData = res.data.data;
                    for (let i = 0; i < res.data.data.length; i++) {
                        this.userList[res.data.data[i].Id] = [];
                        this.delidarray[res.data.data[i].Id] = [];
                    }
                    this.pagination.total = res.data.count;
                    this.doUserList();
                    Loading.close();
                });
            },
            DelArray() {
            },
            doUserList() {
                let loadding = this.openLoading();
                this.$http.post("/UserInfo/GetUsersDetail", {
                    users: {},
                    offset: 1,
                    limit: 100000
                }).then(res => {
                    loadding.close();
                    let userList = this.userList;
                    for (let i = 0; i < res.data.data.length; i++) {
                        let item = res.data.data[i];
                        if (userList[item.DepartmentId]) {
                            userList[item.DepartmentId].push(item)
                        }
                    }
                    userList.all = res.data.data;
                    this.userList = userList;
                });
            },
            ShowAddDeparment() {
                this.AddDepartmentShow = true;
            },
            // 组织架构
            doFlowChart() {
                let flowChartData = {
                    title: "组织架构图",
                    titleBackground: "",
                    titleColor: "",
                    key: "big",
                    subTitle: "",
                    subTitleBackground: "",
                    subTitleColor: "",
                    children: []
                };
                // for (let i = 0; i < this.tableData.length; i++) {
                //     let key = {
                //         LeaderShip: "部门领导",
                //         PartOwner: "部长",
                //         PartOwnerTwo: "副部长",
                //         SectoralFunctions: "部门职能",
                //         PeopleCount: "部门人数"
                //     }
                //     flowChartData.children.push({
                //         title: "部门名称",
                //         titleBackground: "",
                //         titleColor: "",
                //         key: "DepartmentName",
                //         subTitle: this.tableData[i]["DepartmentName"],
                //         subTitleBackground: "",
                //         subTitleColor: "",
                //         children: []
                //     })
                //     for (let k in key) {
                //         if (this.tableData[i][k]) {
                //             flowChartData.children[i].children = this.doChildrenData(flowChartData.children[i].children,
                //                 {
                //                     title: key[k],
                //                     titleBackground: "",
                //                     titleColor: "",
                //                     key: k,
                //                     subTitle: (k === "LeaderShip" || k === "PartOwner" || k === "PartOwnerTwo") ?
                //                         this.GetUserNameById(this.tableData[i][k]) : this.tableData[i][k],
                //                     subTitleBackground: "",
                //                     subTitleColor: "",
                //                     children: []
                //                 }, "children")
                //         }
                //     }
                // }

                for (let i = 0; i < this.tableData.length; i++) {
                    flowChartData.children.push({
                        title: "部门名称",
                        titleBackground: "",
                        titleColor: "",
                        key: "DepartmentName",
                        subTitle: this.tableData[i]["DepartmentName"],
                        subTitleBackground: "",
                        subTitleColor: "",
                        children: []
                    })
                    for (let l = 0; l < this.userList[this.tableData[i].Id].length; l++) {
                        let item = this.userList[this.tableData[i].Id][l];
                        if (item.Id === this.tableData[i].LeaderShip) {
                            flowChartData.children[i].children.push({
                                title: "分管领导",
                                titleBackground: "red",
                                titleColor: "white",
                                key: "DepartmentName_" + item.Id,
                                subTitle: item.UserName,
                                subTitleBackground: "",
                                subTitleColor: "",
                                children: []
                            })
                        } else if (item.Id === this.tableData[i].PartOwner) {
                            flowChartData.children[i].children.push({
                                title: "部长",
                                titleBackground: "blue",
                                titleColor: "white",
                                key: "DepartmentName_" + item.Id,
                                subTitle: item.UserName,
                                subTitleBackground: "",
                                subTitleColor: "",
                                children: []
                            })
                        } else if (item.Id === this.tableData[i].PartOwnerTwo) {
                            flowChartData.children[i].children.push({
                                title: "副部长",
                                titleBackground: "yellow",
                                titleColor: "white",
                                key: "DepartmentName_" + item.Id,
                                subTitle: item.UserName,
                                subTitleBackground: "",
                                subTitleColor: "",
                                children: []
                            })
                        } else {
                            flowChartData.children[i].children.push({
                                title: "员工",
                                titleBackground: "#999999",
                                titleColor: "white",
                                key: "DepartmentName_" + item.Id,
                                subTitle: item.UserName,
                                subTitleBackground: "",
                                subTitleColor: "",
                                children: []
                            })
                        }

                        flowChartData.children[i].children[l].children = this.doChildrenData(flowChartData.children[i].children[l].children,
                            {
                                title: "性别",
                                titleBackground: "",
                                titleColor: "",
                                key: "DepartmentName_" + item.Id + "_Sex",
                                subTitle: item.Sex === 0 ? "男" : "女",
                                subTitleBackground: "",
                                subTitleColor: "",
                                children: []
                            }, "children")
                        flowChartData.children[i].children[l].children = this.doChildrenData(flowChartData.children[i].children[l].children,
                            {
                                title: "岗位",
                                titleBackground: "",
                                titleColor: "",
                                key: "DepartmentName_" + item.Id + "_RoleId",
                                subTitle: this.RoleNamesByids(item.RoleId),
                                subTitleBackground: "",
                                subTitleColor: "",
                                children: []
                            }, "children")
                        flowChartData.children[i].children[l].children = this.doChildrenData(flowChartData.children[i].children[l].children,
                            {
                                title: "职务",
                                titleBackground: "",
                                titleColor: "",
                                key: "DepartmentName_" + item.Id + "_UserPosition",
                                subTitle: this.UserPositionByid(item.UserPosition),
                                subTitleBackground: "",
                                subTitleColor: "",
                                children: []
                            }, "children")
                        let key = {
                            Phone: "联系电话",
                            JobNumber: "工号",
                            Email: "邮箱",
                        }
                        for (let k in key) {
                            flowChartData.children[i].children[l].children = this.doChildrenData(flowChartData.children[i].children[l].children,
                                {
                                    title: key[k],
                                    titleBackground: "",
                                    titleColor: "",
                                    key: "DepartmentName_" + item.Id + "_" + k,
                                    subTitle: item[k],
                                    subTitleBackground: "",
                                    subTitleColor: "",
                                    children: []
                                }, "children")
                        }
                    }
                }
                this.flowChartData = {
                    show: true,
                    data: flowChartData
                }
            },
            doChildrenData(data, children, key) {
                if (data.length) {
                    data[0][key] = this.doChildrenData(data[0][key], children, key);
                } else {
                    data = [children];
                }
                return data;
            },
            GetUserNameById(id) {
                var name = "";
                var obj = this.AllUsers.find((x) => x.Id == id);
                if (obj != null && obj != undefined)
                    name = obj.UserName
                return name;
            },
            edit(obj) {
                this.obj = JSON.parse(JSON.stringify(obj));
                this.UpDepartmentShow = true;
            },
            formal(obj) {
                this.$confirm('确认撤销吗?', '提示', {
                    confirmButtonText: '确定',
                    cancelButtonText: '取消',
                    type: 'info'
                }).then(() => {
                    let loadding = this.openLoading();
                    this.$http.post("/Department/RevokeDepartment", {DepartmentId: obj.Id}).then(res => {
                        loadding.close();
                        if (res.data.bit) {
                            this.$message.success("数据信息撤销成功");
                            this.GettableDB();
                        } else {
                            this.$message.warning("数据信息撤销失败");
                        }
                    })

                })
            },
            leave(obj) {
                this.$confirm('确认删除吗?', '提示', {
                    confirmButtonText: '确定',
                    cancelButtonText: '取消',
                    type: 'info'
                }).then(() => {
                    let loadding = this.openLoading();
                    this.$http.post("/Department/DelDepartment", {Id: obj.Id}).then(res => {
                        loadding.close();
                        if (res.data.bit) {
                            this.$message.success("数据信息删除成功");
                            this.GettableDB();
                        } else {
                            this.$message.warning("数据信息删除失败");
                        }

                    })
                })
            },
            //权限名称
            RoleNamesByids(ids) {
                if (ids != "") {
                    let rolenames = [];
                    let idsstr = ids;
                    let roleids = idsstr.split(',');
                    let _this = this;
                    roleids.forEach(function (item, index) {
                        //item 就是当日按循环到的对象
                        //index是循环的索引，从0开始
                        let iid = parseInt(item);
                        var role = _this.AllRoleDB.find((x) => x.Id == iid);
                        if (role != null) {
                            rolenames.push(role.RoleName);
                        }
                    })
                    return rolenames.join(',');
                }
            },
            UserPositionByid(obj) {
                let mains = this.AllDutyMains.find(x => x.Id == obj);
                if (mains != null) {
                    return (mains.DutyName);
                }
                return "";
            },
            selectionLineChangeHandle(val) {
                this.delidarray[this.DepartmentIds[0]] = val;
            },
            doRowKey(row) {
                return row.Id;
            },
            onExpandChange(row, expandedRows) {
                if (expandedRows.length) {
                    this.DepartmentIds = []
                    if (row) {
                        this.DepartmentIds.push(row.Id)// 每次push进去的是每行的ID
                    }
                } else {
                    this.DepartmentIds = []// 默认不展开
                }
            },
            onOperUser(key, row) {
                // 添加
                if (key === "add") {
                    this.operUserData = {
                        show: true,
                        title: "添加",
                        key: "add",
                        data: {
                            userId: [],
                            DepartmentId: this.DepartmentIds[0]
                        }
                    }
                }
                // 更改部门
                else if (key === "set" || key === "sets") {
                    let userId = [];
                    if (key === "set") {
                        userId = [row.Id]
                    } else {
                        for (let i = 0; i < this.delidarray[this.DepartmentIds[0]].length; i++) {
                            userId.push(this.delidarray[this.DepartmentIds[0]][i].Id)
                        }
                    }
                    if (!userId.length) {
                        this.$message.error("请选择人员！");
                        return;
                    }
                    this.operUserData = {
                        show: true,
                        title: "更改部门",
                        key: key,
                        data: {
                            userId: userId,
                            DepartmentId: ""
                        }
                    }
                }
                // 删除
                else if (key === "del" || key === "dels") {
                    this.$confirm('确认删除吗?', '提示', {
                        confirmButtonText: '确定',
                        cancelButtonText: '取消',
                        type: 'error'
                    }).then(() => {
                        let userId = [];
                        if (key === "del") {
                            userId = [row.Id]
                        } else {
                            for (let i = 0; i < this.delidarray[this.DepartmentIds[0]].length; i++) {
                                userId.push(this.delidarray[this.DepartmentIds[0]][i].Id)
                            }
                        }
                        if (!userId.length) {
                            this.$message.error("请选择人员！");
                            return;
                        }
                        this.operUserData = {
                            show: false,
                            title: "删除",
                            key: key,
                            data: {
                                userId: userId,
                            }
                        }
                        this.onOperUser("post", {})
                    })
                }
                // 更改顺序
                else if (key === "top" || key === "bottom") {
                    this.operUserData = {
                        show: false,
                        title: "更改顺序",
                        key: key,
                        data: {
                            Index: key === "top" ? 1 : -1,
                            DepartmentId: row.Id
                        }
                    }
                    this.onOperUser("post", {})
                }
                // 请求数据
                else if (key === "post") {
                    let data = this.operUserData.data, url = "";
                    if (this.operUserData.key === "add" || this.operUserData.key === "set" || this.operUserData.key === "sets") {
                        url = "Department/UpdateUserDepartment"
                    } else if (this.operUserData.key === "del" || this.operUserData.key === "dels") {
                        url = "Department/DelUserDepartment"
                    }else if (this.operUserData.key === "top" || this.operUserData.key === "bottom") {
                        url = "Department/UpdateDepartmentIndex"
                    }
                    if(data.userId){
                        for (let i = 0; i < data.userId.length; i++) {
                            data.userId[i] = +data.userId[i]
                        }
                    }
                    let loadding = this.openLoading();
                    this.$http.post(url, data).then(res => {
                        loadding.close();
                        if (res.data.bit) {
                            this.$message.success("请求成功");
                            this.GettableDB();
                        } else {
                            this.$message.warning("请求失败");
                        }
                        this.operUserData = {
                            show: false,
                            title: "",
                            key: "",
                            data: {},
                        }
                    })
                }
            },
        },
    }
</script>

<style scoped>

</style>